export const mysqlConnectPromise = async (pool) => {

    return new Promise(function (resolve, reject) {

        pool.getConnection(function (err, connection) {

            if (err) {
                console.log(err);
                resolve(false);
                return;
            }

            resolve(connection);

        });

    });

}

export const mysqlQueryPromise = async (connection, sqlLine) => {

    return new Promise(function (resolve, reject) {

        connection.query(sqlLine, function (error, results) {

            if (error) {
                console.log(error);
                resolve(false);
                return;
            }

            resolve(results);

        });

    });

}